#include <ros/ros.h>
#include <test_topic_roscpp/mymsg.h>

void callbackfun(const test_topic_roscpp::mymsg::ConstPtr &msg)
{
	ROS_INFO("Recv id:%d,value:%f,str:%s",msg->id,msg->value,msg->str.c_str());
}

int main(int argc,char **argv)
{
	ros::init(argc,argv,"recv");

	ros::NodeHandle handle;

	//subscribe第一个参数：订阅的话题
	//第二个参数 
	ros::Subscriber receiver = handle.subscribe("tangyuan",1,callbackfun);

	//进入等待 不返回 类似于while(1);
	ros::spin();

	return 0;
}
